{extend name="pc/admin/layout"/}
{block name="main"}
   <div class="g-1400 g-container" id="pjax-container">
        
<div class="bg-bai b rx3" id="vue-page">
    <div class="t-v t-t">
        <div class="c-sidebar c-sidebar-h pb5 br">
            <div class="c-sidebar-title t-v hui bb">编辑用户:{$data['nickname']}</div>
            <ul class="c-nav click-nav">
				<li class="active"><a class="t-v" href="{:url('pc/admin',['act'=>'data','s'=>'user_list'])}" data-pjax="">
                    <div style="width:35px;"><img class="w6 h6 b r5" src="//q4.qlogo.cn/headimg_dl?dst_uin={$data.qq}&amp;spec=40"></div>
                    <div><font class="v-1">返回列表</font></div>
                </a></li>
            </ul>
        </div>
<div class="c-content bl">
    <div class="g-title t-v pl4 bb">
        <div class="col-8 h t-v bold">用户信息</div>
        <div class="col-4 t-v t-r"></div>
    </div>
    <div class="g-content p5">
				<form id="form" style="padding-left: 25px;padding-right: 25px;">
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">用户名：</dt>
                    <dd><input type="text" name="username" value="{$data.username}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">昵称：</dt>
                    <dd><input type="text" name="nickname" value="{:substr($data.nickname , 0 , 20)}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">账户余额：</dt>
                    <dd><input type="number" name="money" value="{$data.money}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">QQ账号：</dt>
                    <dd><input type="text" name="qq" value="{$data.qq}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">积分：</dt>
                    <dd><input type="text" name="jf" value="{$data.jf}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">配额：</dt>
                    <dd><input type="text" name="peie" value="{$data.peie}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">VIP开始时间：</dt>
                    <dd><input type="date" name="vipstart" value="{$data.vipstart}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">VIP到期时间：</dt>
                    <dd><input type="date" name="viptime" value="{$data.viptime}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">联系邮箱：</dt>
                    <dd><input type="text" name="mail" value="{$data.mail}" class="form p0 h11 bb bb-hui"></dd>
                </div>
				<div class="pt1 pb3 in-text">
					<dt class="bold bb pr2 lan">开通代理：</dt>
					<dd><select class="form w h8 bb" name="dlpower" default="{$data.dlpower}">
						<option value="0"> 不开通</option>
						<option value="1" {if condition="$data.dlpower eq 1" }selected {/if}> 银牌代理</option>
						<option value="2" {if condition="$data.dlpower eq 2" }selected {/if}> 金牌代理</option>
						<option value="3" {if condition="$data.dlpower eq 3" }selected {/if}> 钻石代理</option>
					</select></dd>
				</div>
				<div class="pt1 pb3 in-text">
                    <dt class="bold bb pr2 lan">重置密码：</dt>
                    <dd><input type="password" name="password" placeholder="留空则不修改密码" class="form p0 h11 bb bb-hui"></dd>
                </div>
				</form>
            </div>
</div>
</div>
<div class="c-pagination o-h t-v">
        <div class="c-sidebar"></div>
        <div class="c-content h11 o-h g-btn t-v bt bl">
            <div class="col-12 h t-v f3 hui pl5 pr5 t-c">
			<button class="btn btn-qing btn-md w22 rx1" @click="saveConfig()">保 存 设 置</button></div>
        </div>
    </div>
</div>

    </div>
   {/block}
   {block name='foot'}
		<script>
        new Vue({
            el: '#vue-page',
            methods: {
                saveConfig: function () {
                    app.ajax("{:url('AdminAjax/userList',['action'=>'edit'])}?uid=" + "{$data.uid}", $("#form").serialize(), function (data) {
                        if (data.code === 0) {
                            x.msg(data.message)
                        } else {
                            x.msg(data.message)
                        }
                    })
                }
            }
        });
    </script>
    {/block}